<?php if ( post_password_required() ) {return;}

/*-----------------------------------------------------------------------*/
/*	Display Comments
/*-----------------------------------------------------------------------*/

if ( have_comments() ) : ?>

	<div class="title-block" style="margin: 0 0 30px 0;">
		<h3 id="comment-number"><?php comments_number(__('No comments', 'qns'), __('1 Comment', 'qns'), __('% Comments', 'qns')); ?></h3>
	</div>

	<ul class="comments">
		<?php wp_list_comments( array( 'callback' => 'qns_comments' ) ); ?>
	</ul>

	<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
		
		<?php previous_comments_link( __( '&larr; Older Comments', 'qns' ) ); ?>
		<?php next_comments_link( __( 'Newer Comments &rarr;', 'qns' ) ); ?>

	<?php endif; ?>

<?php endif;

/*-----------------------------------------------------------------------*/
/*	Comment Form
/*-----------------------------------------------------------------------*/

?>

<!-- BEGIN #respond -->
<div id="respond">
		
	<div class="title-block" style="margin: 0 0 30px 0;">
		<h3><?php _e('Leave a Comment','qns'); ?></h3>
	</div>
	
	<div class="cancel-comment-reply">
		<?php cancel_comment_reply_link(); ?>
	</div>
	
	<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
		<p><?php printf(__('You must be %1$slogged in%2$s to post a comment.', 'qns'), '<a href="'.get_option('siteurl').'/wp-login.php?redirect_to='.urlencode(get_permalink()).'">', '</a>') ?></p>
	<?php else : ?>
	
		<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
	
			<?php if ( is_user_logged_in() ) : ?>
		
				<p><?php printf(__('Logged in as %1$s. %2$sLog out &raquo;%3$s', 'qns'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>', '<a href="'.(function_exists('wp_logout_url') ? wp_logout_url(get_permalink()) : get_option('siteurl').'/wp-login.php?action=logout" title="').'" title="'.__('Log out of this account', 'qns').'">', '</a>') ?></p>
		
			<?php else : ?>
			
				<div class="field-row">
					<label for="author"><?php _e('Name','qns'); ?> <?php if ($req) _e("<span>(required)</span>", 'qns'); ?></label>
			   		<input type="text" name="author" id="author" class="text_input" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" />
				</div>
			
				<div class="field-row">
					<label for="email"><?php _e('Email','qns'); ?> <?php if ($req) _e("<span>(required)</span>", 'qns'); ?></label>
			   		<input type="text" name="email" id="email" class="text_input" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" />
				</div>
			
				<div class="field-row">
					<label for="url"><?php _e('Website','qns'); ?> <?php if ($req) _e("<span>(required)</span>", 'qns'); ?></label>
			   		<input type="text" name="url" id="url" class="text_input" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
				</div>
		
			<?php endif; ?>
			
			<div class="field-row">
				<label for="comment"><?php _e('Comment','qns'); ?></label>
				<textarea name="comment" id="comment" class="text_input" cols="60" rows="9" tabindex="4"></textarea>
			</div>
		
			<input name="submit" type="submit" class="button2" tabindex="5" value="<?php _e('Submit Comment', 'qns') ?>" />
			<?php comment_id_fields(); ?>
		
			<?php do_action('comment_form', $post->ID); ?>
	
		</form>

	<?php endif; ?>

<!-- END #respond -->
</div>